<!DOCTYPE html>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<html><head>

<title>订单信息</title>

<meta content="telephone=no" name="format-detection" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
<link type="text/css" rel="stylesheet" href="../../resource/fapiao.css">
<link rel="stylesheet" href="../../resource/weui.min.css"/>
<link rel="stylesheet" href="../../resource/example.css"/>
<!-- 微信引入 -->
<script type="text/javascript" src="../../resource/jweixin-1_002.js"></script>
<script type="text/javascript" src="../../resource/jweixin-1.js"></script>
<script src="../../resource/jquery-1.js"></script>
<script src="../../resource/qrcode.js"></script>
<script src="../../script/api.js"></script>
<link rel="stylesheet" href="../../resource/jinsuistyle.css" />
<script >
	var openid = $api.getStorage('openid');

	function doSendKp(orderid,kpmethod){
		//window.location.href='<%=contextPath%>/wx/Invoice_qyxz.jsp?orderid='+orderid+'&kpmethod='+kpmethod;
		api.openWin({
	        name: '开票页面',
	        url: './Invoice_qyxz.html',
	        pageParam: {
        		orderid: orderid,
        		kpmethod : kpmethod
    		}
        });
	}

	$(function(){
		gridUserInfo();
	});

	function gridUserInfo(){
		var xlist;
	  apiready = function(){
			var header = $api.byId('jsheader');
			if(api.systemType=='ios'){
				$api.fixIos7Bar(header);
			}
//			else{
//				$api.fixStatusBar(header);
//			}
		api.ajax({
    	url: 'http://wechat.scjinsui.com/weixin/wxOrder/gridOrderByOpenid.do',
    	method: 'post',
    	data: {
     	   values: {
            	openid: openid
            	//openid : "12093219439242394uoshdfkjdsnhfsdjkhngjfkhng"
        	}
    	}
		}, function(ret, err) {
		if(ret){
			xlist = ret;
        	if(xlist.length>0){
        		$("#null_indicator").hide();
        	}
        	else{
        		$("#null_indicator").show();
        	}
        	for(var i=0;i<xlist.length;i++){
        		var s;
        		if(xlist[i].STA==1){
        			s="<div class=\"FP_box clearfix\" onclick=\"doSendKp('"+xlist[i].ORDERID+"','"+xlist[i].KPMETHOD+"')\">";
        		}
                else if(xlist[i].STA==2){
                    s="<div class=\"FP_box clearfix\">";
                }
//         		else if(xlist[i].STA==3){
//         			s="<div class=\"FP_box clearfix\" onclick=\"doSendKp('"+xlist[i].ORDERID+"','"+xlist[i].KPMETHOD+"')\">";
//         		}
            	else if(xlist[i].STA==3){
        			s="<div class=\"FP_box clearfix\" >";
        		}
        		else if(xlist[i].STA==4){
        			s="<div class=\"FP_box clearfix\" onclick=\"openZf('"+xlist[i].TOKEN_ID+"')\">";
        		}
        		s+= "<div class=\"fl\" style=\"width: 100%;\">"+
					"<h6><a style=\"color:#fff \">"+ xlist[i].GOODS	+"</a></h6>"+
					"<p style=\"color:#fff;\" id=\"test\">订单号："+xlist[i].ORDERID+"</p>"+
					"<p style=\"color:#fff;\" id=\"test\">金额（元）：￥"+xlist[i].TOTAL+"</p>"+
					"<p style=\"padding-bottom: 45px;color:#fff;\" id=\"test\">订单时间："+xlist[i].ORDER_SDATE+"</p></div>"+
					"<div class=\"FP_box_hint\">&nbsp;&nbsp;订单状态："+xlist[i].STA_MSG+"</div></div>";
				$("#DD_Box").append(s);
        	}
        	}else{
        		api.alert({msg:'网络异常'});
        	}

		});
	  }
	}

	function openZf(tokenid){
		//window.location.href='https://pay.swiftpass.cn/pay/jspay?showwxpaytitle=1&token_id='+tokenid;
	}

</script>
</head>
<body>
	<div id="jsheader">
			<nav id="jsnav">
					<a id="jsleft" tapmode="" onclick="api.closeWin();">
							<span>返回</span>
					</a>
					<div id="jsmiddle">
							<strong id="jstitle">极速开票</strong>
					</div>
					<a id="jsright">
						<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
					</a>
			</nav>
	</div>
		<div style="height:40px">&nbsp;</div>
<div class="weui-tab">
	<div class="weui-tab__panel">
	<div id="loadingToast" style="display:none;">
        <div class="weui-mask_transparent"></div>
        <div class="weui-toast">
            <i class="weui-loading weui-icon_toast"></i>
            <p class="weui-toast__content">请稍后...</p>
        </div>
	</div>
	<div id="DD_Box"></div>
	<div id="null_indicator" style="display:none" class="FP_btn">
		<a style="display:inline-block;display:-moz-inline-stack;width: 90%;color: #888;" href="javascript:;">无订单信息</a>
	</div>
		<div class="page__ft">
<p style="margin-bottom: 6px"><a style="color:#777;font-size:12px">四川航天金穗高技术有限公司</a></p>
</div>
	</div>
	</div>
	<!-- <div class="weui-tabbar" style="box-shadow:0 -2px 2px #aeaeae;">
        <a href="./main.html" class="weui-tabbar__item">
            <img src="../../image/icon_nav_button.png" alt="" class="weui-tabbar__icon">
            <p class="weui-tabbar__label">返回</p>
        </a>
	</div> -->


</body></html>
